﻿@using WI.CandidateManager.Common.Data.Enums
@model WI.CandidateManager.Common.Data.Entities.Coursework

@{
    ViewBag.Title = @Resources.Common.CommonCourseworkEdit;
}

<h2>@Resources.Common.CommonCourseworkEdit</h2>

@using (Html.BeginForm("Edit", "Courseworks", new { @CourseworkId = Model.Id }, FormMethod.Post))
{
    @Html.ValidationSummary(true)
    
    <table class="bordered">
        <tr>
            <td class="vertical-header">@Html.LabelFor(model => model.Name)</td>
            <td>@Html.EditorFor(model => model.Name, new { @class = "" })</td>
        </tr>
        <tr>
            <td class="vertical-header">@Html.LabelFor(model => model.Description)</td>
            <td>@Html.TextAreaFor(model => model.Description, new { @class = "common-textarea-wide" })</td>
        </tr>
        <tr>
            <td class="vertical-header">Attachments</td>
            <td>@Html.ActionLink("Attachments (" + Model.Attachment.Count + ")", "List", "Attachment", new { area = "", entityID = Model.Id, returnUrl = this.Request.RawUrl }, new { @class = "common-btn BlueColor" })</td>
        </tr>
        <tr>
            <td class="vertical-header">@Html.LabelFor(model => model.State)</td>
            <td>@Html.DropDownListFor(model => model.State, new SelectList(Enum.GetValues(typeof(State))))</td>
        </tr>
        <tr>
            <td class="vertical-header">@Html.LabelFor(model => model.Owner.FullName)</td>
            <td>@Html.DisplayFor(model => model.Owner.FullName)</td>
        </tr>
    </table>
    
    <p>
        @Html.ActionLink(@Resources.Common.CommonButtonCancel, "List", "Courseworks", new { @class = "common-btn-large BlueColor" }) <input class="common-btn-large BlueColor" type="submit" value=@Resources.Common.CommonButtonSave />
    </p>
}